<?php
include "../../../lib/list.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head>
<link rel="stylesheet" href="../../../css/list.css" type="text/css"></link>
<link rel="stylesheet" href="../../../css/insert.css" type="text/css"></link>
<link rel="stylesheet" href="../../../css/table.sorter.css" type="text/css" media="print, projection, screen" />
<link type="text/css" rel="stylesheet" href="../../../css/dhtmlgoodies_calendar.css?random=20051112" media="screen"></link>

<script type="text/javascript" src="../../../js/dhtmlgoodies_calendar.js?random=20060118"></script>
<script type="text/javascript" src="../../../js/list.js"></script>
<script type="text/javascript" src="../../../js/jquery-1.2.6.js"></script>
<script type="text/javascript">
function deleteRow(obj){
	$(obj).parent().remove();
}

function moveiframe(s_no){
	iframe.location.href = "tmpiframe.php?s_no="+s_no;
}

function submit(){
	if(check_p_confirm()){
		var form = document.getElementById("iframe").contentWindow.document.view;
		form.target = 'right';
		form.action = 'tmpquery.php';
		form.method = 'post';
		form.submit();
		}
		else{
			return;
		}
}

function check_p_confirm(){
	var form = document.getElementById("iframe").contentWindow.document.view;
    var chk_count = 0;
    for (var i=0; i<form.length; i++) {
        if (form.elements[i].name == "chk_no[]" && form.elements[i].checked)
            chk_count++;
    }
    if (!chk_count) {
        alert("게시물을 하나 이상 선택하세요.");
        return false;
    }
    return true;
}
</script>
</head>
<body>
	<div style="width: 1024px;">
		<div
			style="border-bottom: 1px solid #e8e8e8; text-align: left; font-size: 12px; margin-bottom: 12px; color: #9a9a9a">:::
			재고 관리&nbsp;⇒&nbsp;재고조사입력</div>
		<form name="view" method="post" action="query.php" enctype=multipart/form-data>
			<iframe src="tmpiframe.php" name="iframe" id="iframe" style="width:750px;height:600px;float:right;" frameborder="0"></iframe>
			<div style="width:250px;float:left;">
			<table class="entry fixed H_15px" summary="재고-입력상단부">
						<tr>
						    <th style="width:70%">점포명</th>
							<th style="width:30%">상품수</th>
						</tr>
							<?php 
							$qry = "SELECT count(*) AS 'count',s_no FROM `uatp_stocktmp` WHERE 1 GROUP BY s_no;";
							$query = DBquery($qry);
							while($list = mysql_fetch_array($query)){
								$shop = DBarray("SELECT * FROM uatp_shopinfo WHERE 1 AND no = ".$list['s_no']);
							?>
						<tr onClick="moveiframe('<?=$list['s_no']?>')" onMouseOver="this.style.backgroundColor='#CEE3F6'" onMouseOut="this.style.backgroundColor=''"style="cursor:pointer">
						    <td style="width:75%;height:25px;background:none;"><?=$shop['name']?></td>
							<td style="width:25%;text-align:right;background:none;"><?=$list['count']?>&nbsp;개&nbsp;</td>
						</tr>
						<?php }
							mysql_close();
							?>
						</table>
								
						<div style="padding-top:15px;float-text:center;">
						<center><a href="javascript:submit();" class="button blue small" style="width:80px;">&nbsp;재고확정&nbsp;</a>
								<a href="javascript:location.href='stview.php'" class="button white small" style="width:80px;">&nbsp;뒤로가기&nbsp;</a>
						</center>
						</div>	
						</div>	
			</form>
	</div>
</body>
</html>
